﻿//++
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
// Module Name:
//
//    ThisAddInTest.cs
//
// Abstract:
//
//    All unit tests for ThisAddIn class
//
//
//--

using System;
using System.Diagnostics;
using Microsoft.Office.Interop.Outlook;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Microsoft.EnhancedReminders.OutlookAddIn.UnitTests
{
    
    
    /// <summary>
    ///This is a test class for ThisAddInTest and is intended
    ///to contain all ThisAddInTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ThisAddInTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion

        /// <summary>
        ///A test for ThisAddIn_Shutdown
        ///</summary>
        [TestMethod()]
        [DeploymentItem("Microsoft.EnhancedReminders.OutlookAddIn.dll")]
        public void ThisAddInShutdownTest()
        {
            ThisAddIn_Accessor addIn = new ThisAddIn_Accessor();
            Debug.Assert(addIn != null, "addIn != null");

            object sender = new object();
            Debug.Assert(sender != null, "sender != null");

            EventArgs e = new EventArgs();
            Debug.Assert(e != null, "e != null");

            addIn._inspectors = new MockInspectors();
            Debug.Assert(addIn._inspectors != null, "target._inspectors != null");

            ThisAddIn_Accessor._windows = new System.Collections.Generic.List<OutlookReminderInspector>();
            Debug.Assert(ThisAddIn_Accessor._windows != null, "ThisAddIn_Accessor._windows != null");
                 
            addIn.ThisAddIn_Shutdown(sender, e);

            Assert.AreEqual(null, addIn._inspectors, "_inspectors != null");
            Assert.AreEqual(null, ThisAddIn_Accessor._windows, "_inspectors != null");
        }
    }
}
